from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains

wd = webdriver.Chrome()
wd.maximize_window()
wd.get("http://scitc.fanya.chaoxing.com/portal")
wd.find_element(By.CSS_SELECTOR,".loginSub").click()
wd.find_element(By.CSS_SELECTOR,"#phone").send_keys('19150979228')
wd.find_element(By.CSS_SELECTOR,".ipt-pwd").send_keys('CXR19150979228')
wd.find_element(By.CLASS_NAME,"btn-big-blue").click()
wd.switch_to.frame("frame_content")
# wd.find_element(By.LINK_TEXT,"python程序设计B").click()
# win = wd.window_handles
# wd.switch_to.window(win[-1])
# wd.find_element(By.LINK_TEXT,"讨论").click()
# wd.switch_to.frame("frame_content-tl")
# wd.find_element(By.CLASS_NAME,"commentIcon").click()
# win = wd.window_handles
# wd.switch_to.window(win[-1])
win=wd.window_handles
wd.switch_to.window([win(-1)])
# while 1:
#     wd.find_element(By.XPATH,"//*[@id='bbsTopicDetail']/div/div[2]/div[1]/div[2]/div[1]/i").click()
# wd.find_element(By.XPATH,"//*[@id='subPageMain']/div[3]/div[2]/div/div[1]/textarea").send_keys("软件20-5 陈祥润 20301160")
# wd.find_element(By.XPATH,"//*[@id='subPageMain']/div[3]/div[2]/div/div[4]/div[5]").click()
